package org.naigu.peach.web.action.subject;

import guda.grape.util.RequestUtil;
import org.naigu.peach.biz.SubjectBiz;
import org.naigu.peach.biz.form.SubjectForm;
import org.naigu.peach.biz.form.UserForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;

/**
 * Created by well on 15/10/17.
 */
@Controller
public class SubjectAction {

    @Autowired
    private SubjectBiz subjectBiz;

    @RequestMapping(value = "subject/create.htm", method = RequestMethod.GET)
    public String create(HttpServletRequest request, ModelMap modelMap, SubjectForm subjectForm,
                           BindingResult result) {

        return RequestUtil.resolveVM(request);
    }

    @RequestMapping(value = "subject/doCreate.htm", method = RequestMethod.GET)
    public String doCreate(HttpServletRequest request, ModelMap modelMap,@Valid SubjectForm subjectForm,
                           BindingResult result) {

        return RequestUtil.resolveVM(request);
    }
}
